package com.godz.controller.index2;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.godz.mapper.index2ItemMapper;
import com.godz.pojo.index2Item;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class itemCon {
    final
    index2ItemMapper itemMapper;//项目详细

    public itemCon(index2ItemMapper itemMapper) {
        this.itemMapper = itemMapper;
    }
    //小提示方法名不要和类名相同.
    @RequestMapping("/index2/itemCon")
    public String itemGetCon(Model model, @RequestParam(value = "id") int id){
        QueryWrapper<index2Item> wrapper = new QueryWrapper<index2Item>().eq("id", id);
        index2Item item = itemMapper.selectOne(wrapper);
        model.addAttribute("item",item);
        return "index2Item";
    }
}
